#include "client.h"
int sockfd;
int main(int argc,char *argv[])
{	
	int ret;
	char buf[128];
	sockfd = socket(AF_INET,SOCK_STREAM,0);
	if(sockfd < 0)
	{
		perror("socket failed");
		return -1;
	}
	printf("socket success\n");
	struct sockaddr_in clientaddr;
	clientaddr.sin_family = AF_INET;
	clientaddr.sin_port = htons(atoi(argv[2]));
	clientaddr.sin_addr.s_addr = inet_addr(argv[1]);
	socklen_t addrlen = sizeof(clientaddr);
	if(connect(sockfd,(struct sockaddr *)&clientaddr,addrlen)<0)
	{
		perror("connect failed");
		return -1;
	}
	printf("connect success\n");
	while(1)
	{
		show(sockfd);	
	}
	return 0;
}
